package com.classicmodels.controller;

import java.sql.Connection;
import java.sql.DriverManager;

public class AppController {

    private static final String CONNECTION_STRING = "jdbc:mysql://192.168.0.110/classic_models_inc";
    private static final String usuario = "curso";
    private static final String password = "curso";
    private static CustomerController customerController = new CustomerController();

    public static void init() throws Exception {
        Connection c = conectarBaseDeDatos();
        customerController = new CustomerController(c);
        customerController.show_customers();

    }


    //se conecta a la base de datos y me devuelve un objeto
    private static Connection conectarBaseDeDatos() throws Exception {
        Class.forName("com.mysql.jdbc.Driver");
        Connection c = DriverManager.getConnection(CONNECTION_STRING, usuario, password);
        return c;


    }
}


